#!/usr/bin/env python

import wx
import resource.toolbar as toolbar

class ToolBar(wx.ToolBar):
    '''ToolBar class
    
    @author Julot <andy.julot@gmail.com>
    @since Thursday, February 02, 2012. 09:37 PM'''
    
    def __init__(self, parent):
        style = wx.TB_HORIZONTAL | wx.TB_FLAT
        super(ToolBar, self).__init__(parent, style=style)
        self.SetToolBitmapSize((16, 16))
        
        s = 'Browse folder...'
        tool = self.AddTool(-1,
                            bitmap=toolbar.FolderOpenImage.Bitmap,
                            shortHelpString='Browse...',
                            longHelpString=s)
        self.browse = tool
        
        self.AddSeparator()
        
        s = 'Print image'
        tool = self.AddTool(-1,
                            bitmap=toolbar.Printer.Bitmap,
                            shortHelpString='Print',
                            longHelpString=s)
        self.mold = tool
        self.disableMold()
        
        s = 'Printer settings...'
        tool = self.AddTool(-1,
                            bitmap=toolbar.PrinterPencil.Bitmap,
                            shortHelpString='Printer Setting...',
                            longHelpString=s)
        self.printerSettings = tool
        
        self.AddSeparator()
        
        tool = self.AddTool(-1,
                            bitmap=toolbar.QuestionButton.Bitmap,
                            shortHelpString='Help',
                            longHelpString='Help')
        self.aid = tool
        
        tool = self.AddTool(-1,
                            bitmap=toolbar.About.Bitmap,
                            shortHelpString='About',
                            longHelpString='About')
        self.about = tool
        
        self.AddSeparator()
        
        s = 'Close the application'
        tool = self.AddTool(-1,
                            bitmap=toolbar.DoorOpenOut.Bitmap,
                            shortHelpString='Quit',
                            longHelpString=s)
        self.close = tool

    def enableMold(self):
        self.EnableTool(self.mold.Id, True)
    
    def disableMold(self):
        self.EnableTool(self.mold.Id, False)
